use "C:\Users\mmunjoma\Documents\TRaC on SRH\Zim TRaC Family Planning 2007 - 2013 - Merged Shortfile as at 6 Sept 2013.dta", clear
lookfor year
tab Year
drop if Year<2010
save "C:\Users\mmunjoma\Documents\TRaC on SRH\Zim TRaC Family Planning 2007 - 2013 - Merged Shortfile as at 6 Sept 2013.dta", replace
use "C:\Users\mmunjoma\Documents\TRaC on SRH\TRaC_30062015_final (2).dta", clear
append using  "C:\Users\mmunjoma\Documents\TRaC on SRH\Zim TRaC Family Planning 2007 - 2013 - Merged Shortfile as at 6 Sept 2013.dta"
save "C:\Users\mmunjoma\Documents\TRaC on SRH\TraC reports\FP merged_2010-2015.dta"
save "C:\Users\mmunjoma\Documents\TRaC on SRH\TraC reports\FP merged_2010-2015final1611.dta"
tab Year
recode Year .=2015
tab Year

numlabel,add

*********************MONITORING************************************************

****use "C:\Users\mmunjoma\Documents\TRaC on SRH\TraC reports\FP shortfile2010-2015.dta"****

***merge gender variable***
tab Q_102 Year
tab Q102 Year
recode Q102 (1 = 2) (2 = 1), gen(newQ102)
gen genderfin=max(Q_102, newQ102) if missing(Q_102, newQ102)
tab genderfin Year
label define genderfin 1 "female" 2 "male",replace
label values genderfin genderfin
tab genderfin

****merge age variable
tab Age Year 
tab Q_101 Year 
gen agefin=max(Age, Q_101) if missing(Age, Q_101)
sum agefin


***currently using FP merge with 2015 - anymethod****
tab anymethod Year,col
tab Q_401
recode anymethod .=1 if Q_401==1
recode anymethod 2=0
recode anymethod .=0 if Q_401~=. & Q_401~=1
label define anymethod 1 "Yes" 0 "No"
label values anymethod anymethod

tab anymethod Year if genderfin==1,col
oneway anymethod Year,bonf

***by rural urban 2015
tab anymethod Q_5 if genderfin==1 & Year==2015,col chi

******************% of women ages 15�49 years reporting currently using family planning products ******

****modern contraceptives*****
**2015 generating modern method variable
gen modern15=1 if Q_401a_O1<8 | Q_401a_O2<8| Q_401a_O3<8| Q_401a_O4<8| Q_401a_O5<8| Q_401a_O6<8| Q_401a_O7<8| Q_401a_O8<8| Q_401a_O9<8| Q_401a_O10<8| Q_401a_O11<8| Q_401a_O12<8| Q_401a_O13<8| Q_401a_O14<8| Q_401a_O15<8| Q_401a_O16<8
tab modern15
tab modern15
recode modern15 .=0
label define modern15 0 "not using mordern" 1 "using modern",replace
label values modern15 modern15
tab modern15

tab modern15 Year
recode modern15 .=0 if Year==2015
tab modern_prev Year
recode modern_prev .=0 if Year<2015
gen modernfin=max(modern15,modern_prev) if missing(modern15,modern_prev)
label define modernfin 1 "user" 0 "Non user"
label values modernfin modernfin
oneway modernfin Year if genderfin==1, tabu bonf

***by rural urban 2015
oneway  modernfin Q_5 if genderfin==1 & Year==2015, tabu bonf


***2015 availability****
recode Q_422_-Q_430_ (1=5) (2=4) (3=3) (4=2) (5=1) (6=.), pre(new) test
gen fam_avail = (newQ_422_ + newQ_423_ + newQ_424_ + newQ_425_ + newQ_426_ + newQ_427_ + newQ_428_ + newQ_429_ + newQ_430_)/9
sum fam_avail
**2010 and 2013
sort Year
by Year: sum FPavailability
gen fpavailfin= max(fam_avail, FPavailability) if missing(fam_avail, FPavailability)
sum fpavailfin
oneway fpavailfin Year,bonf tabu
**2015 rural urban
oneway fam_avail Q_5,bonf tabu


***2015 social support****
recode Q_431_ - Q_437_ (1=5) (2=4) (3=3) (4=2) (5=1) (6=.), pre(new) test
gen fam_ssupport = (newQ_431_ + newQ_432_ + Q_433_ + newQ_434b_ + newQ_435_ + Q_436_ + newQ_437_)/7
sum fam_ssupport
**2010 and 2013
by Year: sum FPsocsupot
gen fpsupportfin= max(fam_ssupport, FPsocsupot) if missing(fam_ssupport, FPsocsupot)
sum fpsupportfin
oneway fpsupportfin Year,bonf tabu
**2015 rural urban
oneway fam_ssupport Q_5,bon tabu

***2015 self efficacy****
recode Q_438_ - Q_445 (1=5) (2=4) (3=3) (4=2) (5=1) (6=.), pre(new) test
gen fam_efficacy = (newQ_438_ + newQ_439_ + newQ_440_ + newQ_441 + newQ_442 + newQ_443 + newQ_444 + newQ_445)/8
sum fam_efficacy
**2010 and 2013
by Year: sum FPselfefficacy
gen fpefficacyfin= max(fam_efficacy, FPselfefficacy) if missing(fam_efficacy, FPselfefficacy)
sum fpefficacyfin
oneway fpefficacyfin Year,bonf tabu
**2015 rural urban
oneway fpefficacyfin Q_5,bonf tabu

****dual protection - Proportion of women of reproductive age who adopt both the condom and one other modern contraceptive method 

**2010 and 2013 -
tab Dual Year  

***2015 gen condom use****
gen condom15=1 if Q_401a_O1==2| Q_401a_O1==3
recode condom15 .=1 if  Q_401a_O2==2 | Q_401a_O2==3
recode condom15 .=1 if  Q_401a_O3==2 | Q_401a_O3==3
recode condom15 .=1 if  Q_401a_O4==2 | Q_401a_O4==3
recode condom15 .=1 if  Q_401a_O5==2 | Q_401a_O5==3
recode condom15 .=1 if  Q_401a_O6==2 | Q_401a_O6==3
recode condom15 .=1 if  Q_401a_O7==2 | Q_401a_O7==3
recode condom15 .=1 if  Q_401a_O8==2 | Q_401a_O8==3
recode condom15 .=1 if  Q_401a_O9==2 | Q_401a_O9==3
recode condom15 .=1 if  Q_401a_O10==2 | Q_401a_O10==3
recode condom15 .=1 if  Q_401a_O11==2 | Q_401a_O11==3
recode condom15 .=1 if  Q_401a_O12==2 | Q_401a_O12==3
recode condom15 .=1 if  Q_401a_O13==2 | Q_401a_O13==3
recode condom15 .=1 if  Q_401a_O14==2 | Q_401a_O14==3
recode condom15 .=1 if  Q_401a_O15==2 | Q_401a_O15==3
recode condom15 .=1 if  Q_401a_O16==2 | Q_401a_O16==3
tab condom15
recode condom15 .=0 if Q_401~=.

label define condom15 0 "non user" 1 "user",replace
label values condom15 condom15
tab condom15

****proportion of women of reproductive age who adopt both the condom and one other modern contraceptive method 
***among all women
gen dualall=1 if modernfin==1 & condomfin==1
recode dualall .=0 if genderfin==1
tab dualall Year
oneway dualall Year if genderfin==1, bonf tabu
***by rural and urban
oneway dualall Q_5 if genderfin==1, bonf tabu 

**among FP users
gen dual2=dualall
replace dual2=. if  modernfin!=1 
tab dual2 Year
oneway dual2 Year if genderfin==1, bonf tabu
***by rural and urban
oneway dual2 Q_5 if genderfin==1, bonf tabu 


********Proportion of women of reproductive age who use either Implant or IUCD ******

***2015 gen IUCD or Implant variable
tab Q_401a_O5
gen implant_IUCD=1 if Q_401a_O1==6| Q_401a_O1==7
recode implant_IUCD .=1 if  Q_401a_O2==6 | Q_401a_O2==7
recode implant_IUCD .=1 if  Q_401a_O3==6 | Q_401a_O3==7
recode implant_IUCD .=1 if  Q_401a_O4==6 | Q_401a_O4==7
recode implant_IUCD .=1 if  Q_401a_O5==6 | Q_401a_O5==7
recode implant_IUCD .=1 if  Q_401a_O6==6 | Q_401a_O6==7
recode implant_IUCD .=1 if  Q_401a_O7==6 | Q_401a_O7==7
recode implant_IUCD .=1 if  Q_401a_O8==6 | Q_401a_O8==7
recode implant_IUCD .=1 if  Q_401a_O9==6 | Q_401a_O9==7
recode implant_IUCD .=1 if  Q_401a_O10==6 | Q_401a_O10==7
recode implant_IUCD .=1 if  Q_401a_O11==6 | Q_401a_O11==7
recode implant_IUCD .=1 if  Q_401a_O12==6 | Q_401a_O12==7
recode implant_IUCD .=1 if  Q_401a_O13==6 | Q_401a_O13==7
recode implant_IUCD .=1 if  Q_401a_O14==6 | Q_401a_O14==7
recode implant_IUCD .=1 if  Q_401a_O15==6 | Q_401a_O15==7
recode implant_IUCD .=1 if  Q_401a_O16==6 | Q_401a_O16==7
tab implant_IUCD 

***IUCD or Implant variable 2010 and 2013
tab larc Year
****IUCD or implant 2015
tab implant_IUCD Year
**merged
gen imp_IUDfin=max(larc, implant_IUCD) if missing(larc, implant_IUCD)
tab imp_IUDfin
recode imp_IUDfin .=0
label define imp_IUDfin 1 "yes" 0 "no",replace
label values imp_IUDfin imp_IUDfin
tab imp_IUDfin
tab imp_IUDfin Year if genderfin==1,col
oneway imp_IUDfin Year, bonf tabu
***by rural and urban
tab imp_IUDfin Q_5 if genderfin==1,col
oneway imp_IUDfin Q_5, bonf tabu

*******Proportion of women of reproductive age who use either Implant or IUCD together with a condom 
tab condomuse Year
tab condom15 Year,col
gen condomfin =max(condomuse, condom15) if missing(condomuse, condom15)
tab condomfin Year,col

gen imp_dualfin=1 if condomfin==1 & imp_IUDfin==1
recode imp_dualfin .=0 if genderfin==1
tab imp_dualfin
label define imp_dualfin 1 "use implants iud and condoms"  0 "non user"
label values imp_dualfin imp_dualfin
oneway imp_dualfin Year if genderfin==1, tabu bonf
***by rural and urban
oneway imp_dualfin Q_5 if genderfin==1, bonf tabu

***% of women who say their partner supports the use of modern contraception and condoms for dual protection of HIV and unintended pregnancy**** 
tab Q_419_
gen partner_dualsupport=0 if Q_419_!=. & Q_419_!=3
tab Patnasupotsdual Year
tab partner_dualsupport Year

gen dualsupportfin =max(Patnasupotsdual, partner_dualsupport) if missing(Patnasupotsdual, partner_dualsupport)
tab dualsupportfin
label define dualsupportfin 1 "yes" 0 "no",replace
label values dualsupportfin dualsupportfin
oneway dualsupportfin Year if genderfin==1,bonf tabu
***by rural and urban
oneway dualsupportfin Q_5 if genderfin==1, bonf tabu

****% of women who say their partner approves concurrent use of condoms and other modern contraception (dual protection) 
 ***2013 and 2010
 tab Q437_FP_Social_Support Year
 gen Q437_prev=1 if Q437_FP_Social_Support==4 | Q437_FP_Social_Support==5
 recode Q437_prev .=0 if Q437_FP_Social_Support<4
  ***2015
 tab Q_437_ Year
 gen Q437_15=1 if Q_437_ ==1 | Q_437_ ==2
 recode Q437_15 .=0 if Q_437_ ==3 | Q_437_ ==4 | Q_437_ ==5
 
gen approve_dual= max(Q437_15,Q437_prev) if missing(Q437_15,Q437_prev) 
label define approve_dual 1 "yes" 0 "no",replace
label values approve_dual approve_dual
oneway approve_dual Year if genderfin==1,bonf tabu
***by rural and urban
oneway approve_dual Q_5 if genderfin==1, bonf tabu


***unmet need 2013
tab unmetneed Year
gen unmetneed13=unmetneed if married==1 & genderfin==1 & Year==2013
tab unmetneed13
***unmetneed 2015
tab unmetneed15
gen unmetneedfin=max(unmetneed13, unmetneed15) if missing(unmetneed13, unmetneed15) 
tab unmetneedfin Year
oneway unmetneedfin Year,bonf tabu

***rural urban 2015
oneway unmetneed15 Q_5,bonf tabu



*******************************************************************************
********EVALUATION: use "C:\Users\mmunjoma\Documents\TRaC on SRH\TraC reports\FP 2015 dataset.dta"******

tab Q_400c

***mass media: radio, tv, newpaper, billboard
gen fp_massmedia=1 if Q400dRadio==1 | Q400dTelevision==1 | Q400dNewspaper_magazine==1 | Q400dBillboard==1
recode fp_massmedia .=0
label define fp_massmedia 1 "exposed" 0 "not exposed"
label values fp_massmedia fp_massmedia
tab fp_massmedia

***IPC: - workshops, health facilities, friends and relatives
gen fp_ipc=1 if Q400dWorkshop==1 | Q400dHealthFacilities==1 |  Q400dFriends_relatives==1
recode fp_ipc .=0
label define fp_ipc 1 "exposed" 0 "not exposed"
label values fp_ipc fp_ipc
tab fp_ipc

***IEC: - poster
 gen fp_iec=1 if Q400dPoster==1
 recode fp_iec .=0
label define fp_iec 1 "exposed" 0 "not exposed"
label values fp_iec fp_iec
tab fp_iec
 ******************************************************************************
 
 ***mass media****************************************************
 drop cem_strata cem_matched cem_weights
 
 imb Q_102 Q_103 Q_101 Q_5 radio_listen tv_listen Q105InternetAccess, treatment(fp_massmedia)
 ****L1 distance: .45043637
  imb Q_102 Q_103 Q_101 radio_listen tv_listen Q105InternetAccess, treatment(fp_massmedia)
 ****L1 distance:  .38896907 excluding residence 
cem Q_102 Q_103 Q_101 radio_listen tv_listen Q105InternetAccess, treatment(fp_massmedia)
***L1 distance: .12726272

***currently using FP products 2015 (fpuse = modern contraceptives)****

anova modern15 fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1
margin i.fp_massmedia
 
 ***availability
anova fam_avail fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 
margin i.fp_massmedia

 ***social support
anova fam_ssupport fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 
margin i.fp_massmedia

 ***efficacy
anova fam_efficacy fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 
margin i.fp_massmedia

 ***a. Proportion of women of reproductive age who adopt both the condom and one other modern contraceptive method  - among all women
gen dual15a=1 if modern15==1 & condom15==1
recode dual15a .=0 if Q_102==1
anova dual15a fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1
margin i.fp_massmedia
 
***b. Proportion of women of reproductive age who adopt both the condom and one other modern contraceptive method  - among FP users
anova dual15a fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 & modern==1
margin i.fp_massmedia

 *******Proportion of women of reproductive age who use either Implant or IUCD****
recode implant_IUCD .=0
label define implant_IUCD 0 "no" 1 "yes"
label values implant_IUCD implant_IUCD
tab implant_IUCD

anova implant_IUCD fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_massmedia
 
 *******Proportion of women of reproductive age who use either Implant or IUCD together with a condom 
 gen imp_dual15=1 if condom15==1 & implant_IUCD==1
 recode imp_dual15 .=0
 label define imp_dual15 0 "no" 1 "yes"
label values imp_dual15 imp_dual15
tab imp_dual15

anova imp_dual15 fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_massmedia

****% of women who say their partner supports the use of modern contraception and condoms for dual protection of HIV and unintended pregnancy 
tab partner_dualsupport
anova partner_dualsupport fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_massmedia

***% of women who say their partner approves concurrent use of condoms and other modern contraception (dual protection) 
tab Q437_15
anova Q437_15 fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_massmedia

****% of married women reporting that they have an unmet need for Family Planning 
tab unmetneed15
anova unmetneed15 fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_massmedia

********************************************************************************
 ***IPC****************************************************
 drop cem_strata cem_matched cem_weights
 
 imb Q_102 Q_103 Q_101 Q_5 radio_listen tv_listen Q105InternetAccess, treatment(fp_ipc)
 ****L1 distance:  .41387793
  imb Q_102 Q_103 Q_101 radio_listen tv_listen Q105InternetAccess, treatment(fp_ipc)
 ****L1 distance: .3308823 excluding residence 
cem Q_102 Q_103 Q_101 radio_listen tv_listen Q105InternetAccess, treatment(fp_ipc)
***L1 distance:  .1248367 

***currently using FP products 2015 (fpuse = modern contraceptives)****

anova modern15 fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1
margin i.fp_ipc
 
 ***availability
anova fam_avail fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 
margin i.fp_ipc

 ***social support
anova fam_ssupport fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 
margin i.fp_ipc

 ***efficacy
anova fam_efficacy fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 
margin i.fp_ipc

 ***a. Proportion of women of reproductive age who adopt both the condom and one other modern contraceptive method  - among all women
anova dual15a fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1
margin i.fp_ipc
 
***b. Proportion of women of reproductive age who adopt both the condom and one other modern contraceptive method  - among FP users
anova dual15a fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 & modern==1
margin i.fp_ipc

 *******Proportion of women of reproductive age who use either Implant or IUCD****
anova implant_IUCD fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_ipc
 
 *******Proportion of women of reproductive age who use either Implant or IUCD together with a condom 
anova imp_dual15 fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_ipc

****% of women who say their partner supports the use of modern contraception and condoms for dual protection of HIV and unintended pregnancy 
tab partner_dualsupport
anova partner_dualsupport fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_ipc

***% of women who say their partner approves concurrent use of condoms and other modern contraception (dual protection) 
tab Q437_15
anova Q437_15 fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_ipc

****% of married women reporting that they have an unmet need for Family Planning 
tab unmetneed15
anova unmetneed15 fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_ipc

********************************************************************************

 ***IEC****************************************************
 drop cem_strata cem_matched cem_weights
 
 imb Q_102 Q_103 Q_101 Q_5 radio_listen tv_listen Q105InternetAccess, treatment(fp_iec)
 ****L1 distance: 0.53249416
  imb Q_102 Q_103 Q_101 radio_listen tv_listen Q105InternetAccess, treatment(fp_iec)
 ****L1 distance: 0.45331454 excluding residence 
cem Q_102 Q_103 Q_101 radio_listen tv_listen Q105InternetAccess, treatment(fp_iec)
***L1 distance:  .17458216

***currently using FP products 2015 (fpuse = modern contraceptives)****

anova modern15 fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1
margin i.fp_iec
 
 ***availability
anova fam_avail fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 
margin i.fp_iec

 ***social support
anova fam_ssupport fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 
margin i.fp_iec

 ***efficacy
anova fam_efficacy fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 
margin i.fp_iec

 ***a. Proportion of women of reproductive age who adopt both the condom and one other modern contraceptive method  - among all women
anova dual15a fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1
margin i.fp_iec
 
***b. Proportion of women of reproductive age who adopt both the condom and one other modern contraceptive method  - among FP users
anova dual15a fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 & modern==1
margin i.fp_iec

 *******Proportion of women of reproductive age who use either Implant or IUCD****
anova implant_IUCD fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_iec
 
 *******Proportion of women of reproductive age who use either Implant or IUCD together with a condom 
anova imp_dual15 fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_iec

****% of women who say their partner supports the use of modern contraception and condoms for dual protection of HIV and unintended pregnancy 
tab partner_dualsupport
anova partner_dualsupport fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_iec

***% of women who say their partner approves concurrent use of condoms and other modern contraception (dual protection) 
tab Q437_15
anova Q437_15 fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_iec

****% of married women reporting that they have an unmet need for Family Planning 
tab unmetneed15
anova unmetneed15 fp_massmedia fp_ipc fp_iec Q_5[weight= cem_weights] if cem_matched==1 & Q_102==1 
margin i.fp_iec






